<?php
$s_resources = array();
$s = "";
?>
<form method="post" action="<?php echo $this->base_url; ?>/acl/" id="frmConfigAcl" name="frmConfigAcl">
<table cellspacing="0" cellpadding="0" class="tblborder" width="100%">
  <tr class="tblhead">
    <td> - </td>
    <?php
		  foreach ($this->roles as $role):
			?>
    <td><?php echo $role; ?> </td>
    <?php
			endforeach;
			?>
    <td> 全选 </td>
  </tr>
  <?php
foreach ($this->resources as $module => $resource):
	$s_resources[] = $s_resource = $module;
	?>
  <tr class="tblbody">
    <td><?php echo $s_resource; ?> </td>
    <?php
		  foreach ($this->roles as $role):
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $s_resource; ?>][]" id="fields_resource_<?php echo $s_resource; ?>__<?php echo $role; ?>" value="<?php echo $role; ?>" checked="true"/>
    </td>
    <?php
			endforeach;
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $module; ?>][]" id="fields_resource_<?php echo $module; ?>__ALL" value="ALL" checked="true" />
    </td>
  </tr>
  <?php
	foreach ($resource as $controller => $actions):
	$s_resources[] = $s_resource = $module . '_' . $controller;
	?>
  <tr class="tblbody">
    <td>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $s_resource; ?> </td>
    <?php
		  foreach ($this->roles as $role):
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $s_resource; ?>][]" id="fields_resource_<?php echo $s_resource; ?>__<?php echo $role; ?>" value="<?php echo $role; ?>" checked="true"/>
    </td>
    <?php
			endforeach;
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $s_resource; ?>][]" id="fields_resource_<?php echo $s_resource; ?>__ALL" value="ALL" checked="true"/>
    </td>
  </tr>
  <?php
	foreach ($actions as $action):
	$s_resources[] = $s_resource = $module . '_' . $controller . '_' . $action;
	?>
  <tr class="tblbody">
    <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $s_resource; ?> </td>
    <?php
		  foreach ($this->roles as $role):
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $s_resource; ?>][]" id="fields_resource_<?php echo $s_resource; ?>__<?php echo $role; ?>" value="<?php echo $role; ?>" checked="true"/>
    </td>
    <?php
			endforeach;
			?>
    <td><input type="checkbox" name="fields[resource][<?php echo $s_resource; ?>][]" id="fields_resource_<?php echo $s_resource; ?>__ALL" value="ALL" checked="true"/>
    </td>
  </tr>
  <?php
	endforeach;
	?>
  <?php
	endforeach;
	?>
  <?php
		endforeach;
		?>
  <?php

?>
<tr class="tblfoot">
<td colspan="10"><input type="submit" value="提交"/>   </td>
</tr>
</table>
  <script type="text/javascript">
<!--
<?php
foreach ($s_resources as $s_resource)
{
	echo getSlaveMasterCheckBoxes($s_resource, $this->roles);
}
?>
//-->
</script>